#pragma once

#include <string>
#include <xstring>

enum FileCode
{
    code_Ansi,
    code_Unicode,
    code_UnicodeBG,
    code_UTF8
};

class CFileEx
{
public:
    CFileEx();
    CFileEx(char* filePath);
    ~CFileEx();

    FileCode CheckFileCode();
    std::string ReadFile();
    bool WriteFile(std::string filePath, std::string txt);
private:
    char* m_filePath;

    std::string ws2s(const std::wstring & ws);
    std::wstring s2ws(const std::string & s);
};

